import requests
import re

url = 'https://api.bilibili.com/x/web-interface/wbi/index/top/feed/rcmd?web_location=1430650&y_num=4&fresh_type=4&feed_version=V8&fresh_idx_1h=1&fetch_row=4&fresh_idx=1&brush=1&homepage_ver=1&ps=12&last_y_num=5&screen=2048-394&seo_info=&last_showlist=av_1806408875,av_1256708328,av_1806373355,av_1256307231,av_1556252976,av_1006541646,ad_n_5614_935213806,av_n_1406420131,av_n_1056456161,av_n_1606265666&uniq_id=548468468068&w_rid=3068580e245c84f734a0e65061447661&wts=1725353640'
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36'
}

response = requests.get(url, headers=headers)

response_data = response.json()

print(type(response_data), response_data)

data = response_data.get('data', {})

print(data)

for i in data.get('item', []):
    print(i)